package org.example.springboot.common.generater;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
import org.example.springboot.common.generater.config.JdbcProperties ;
import org.example.springboot.common.generater.config.CodeGeneratorProperties;

@Component
public class CodeGeneratorRunner implements ApplicationRunner {

    @Autowired
    private JdbcProperties jdbcProperties;

    @Autowired
    private CodeGeneratorProperties codeGeneratorProperties;

    @Autowired
    private CodeGenerator codeGenerator;


    @Override
    public void run(ApplicationArguments args) throws Exception {
        codeGenerator.generator(jdbcProperties, codeGeneratorProperties);
    }
}
